<%@ page language="java" import="com.jysz.certificate.utils.DateUtil" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="${contextPath}/scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<title>银行日报表</title>
	<link href="${contextPath}/styles/default.css" rel="stylesheet" type="text/css" />
	<script src="${contextPath}/scripts/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
	<script src="${contextPath}/scripts/scriptvalidator.js" type="text/javascript"></script>
	<script src="${contextPath}/scripts/common.js" type="text/javascript"></script>
</head>
<body>
 

<div class="navigation">
	    <span><a href="javascript:window.history.back();"><img src="${contextPath}/images/back_nav_btn.png" /></a>
	    <a href="javascript:window.history.back();">返回</a>
	    <a href="javascript:window.history.forward();"><img src="${contextPath}/images/go_nav_btn.png" /></a>
	     <a href="javascript:window.history.forward();">前进</a>
	    <a href="javascript:window.location.reload();"><img src="${contextPath}/images/refresh_nav_btn.png" /></a>
	     <a href="javascript:window.location.reload();">刷新</a>
	    </span>报表管理&gt;&gt;银行日报表
    </div>
<div class="xt_main_right_center">
<form name="searchForm" method="post" id="submitForm" onSubmit="return checkSubmit();"  action="<s:property value='contextPath'/>/jr/outputShops_BankDaily_XLS.do">
 	<input type="hidden" value="<%=java.net.URLEncoder.encode("银行日报表"+DateUtil.formatDate(DateUtil.getDate(), "yyyyMMdd"),"utf-8")%>" name="documentName" />
  <table width="100%" border="0">
    <tr>
      <td class="left-td-width-bg" align="right">金融机构：</td>
      <td class="right-td-width-bg-left"><label>
      <input type="hidden" name="para.FINANCIAL_NAME" id="fianlName">
        <select  dataType="Require" msg="请选择金融机构"   name="para.FINANCIAL_ID" id="select" onchange="getSelectedText()">
	       <option value="">请选择</option>
	        <s:iterator value="financials" status="i" id="b">
			   <option value="${b.id }">${b.name}</option>
			</s:iterator>
        </select>
      </label></td>
      <td class="left-td-width-bg" align="right">4S店：</td>
      <td class="right-td-width-bg-left">
      				<!-- 当前用户店提交给ireport -->
<%--       		      <s:iterator value="shops" status="i" id="b"> --%>
<%-- 		         	 <input type="hidden" name="shopMap[${b.id}]" value="${b.shopName}"/> --%>
<%-- 		          </s:iterator> --%>
      <s:if test="@com.jysz.certificate.persistence.enums.PostType@Shop.equals(user.post)">
           <select onChange="ShowHidden();" class="input" name="shopIdLong" id="shopSelect">
           			<option value="">请选择</option>
           			
		         <s:iterator value="shops" status="i" id="b">
		          <option value="${b.id}" <s:if test="defaultShop != null && #b.id == defaultShop.id">selected="selected"</s:if>>${b.shopName}</option>
		          </s:iterator>
		      </select>
		      
          </s:if>
          <s:else>
          <input type="text" name="paME" id="table" class="input-readonly" readonly="readonly" />
         	 <a href="javascript:show();"><img src="${contextPath}/images/chakan.gif" alt="选择店铺" width="16" height="13" border="0" /></a>
          </s:else>
			 <input type="hidden" name="para.SHOP_NAME" id="shopName" value=""${defaultShop.shopName} />
    	     <input type="hidden" name="para.SHOP_ID" id="shopId" value=""${defaultShop.id} />
      </td>
    </tr>
    <tr>
      <td class="left-td-width-bg" align="right">日期：</td>
      <td class="right-td-width-bg-left">
     		 <input id="dateBeg" class="Wdate"  dataType="Require" msg="请选择日期"   onBlur="duibi()" type="text" name="para.PARAM_DATE" width="200px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="date" format="yyyy-MM-dd"/>"/>
     	   </td>
      <td colspan="2" align="right"><label>
        <input type="submit" name="button" id="button" value="生成报表">
      </label></td>
      </tr>
  </table>
	 
</form> 
</div><br/><br/>
		<div><jsp:include page="/include/footer.inc"></jsp:include></div>
<script  language='javascript'>
//获取下拉列表选中项的文本
function getSelectedText(){
	var obj=document.getElementById("select");
	var fianlName =document.getElementById("fianlName");
	for(var i=0;i<obj.length;i++){
	   if(obj[i].selected==true || obj[i].selected == 'selected'){
		   fianlName.value = obj[i].innerText;
	   }
	}
	}
function ShowHidden(){
	var obj=document.getElementById("shopSelect");
	var shopName =document.getElementById("shopName");
	var shopId =document.getElementById("shopId");
	for(var i=0;i<obj.length;i++){
	   if(obj[i].selected==true || obj[i].selected == 'selected'){
		   shopName.value = obj[i].innerText;
		   shopId.value = obj[i].value;
	   }
	}
	}
function checkSubmit(){
 	var staffForm = document.searchForm;
	if(!Validator.Validate(staffForm, 3)){
		return false;
	}
	return true;
 }
function selectShopCallBack(hao, ming, id){
	document.getElementById("table").value="("+hao+"/"+ming+")";
	document.getElementById("shopName").value=ming;
	document.getElementById("shopId").value=id;
	}
function show(){
	window.open("${contextPath}/system/treaty/selectShop.do?allIds="+$('#shops_id').val(), "newwindow", "height=900, width=1024, toolbar =no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
	//window.open("<s:property value='contextPath'/>/system/treaty/selectShop.do", "newwindow", "height=500, width=600, toolbar =no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
}
 
function choose_shop(ids,names){
	$("#shopName").val(names);
}
</script>
 
</body>
</html>